home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Examples / Draw / Include / DrawPrxy.h < prev    next >
Encoding:
Text File  |  1995-11-08  |  4.5 KB  |  166 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                DrawPrxy.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Author:                Henri Lamiraux
  7. //
  8. //    Copyright:    © 1993, 1995 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef DRAWPRXY_H
  13. #define DRAWPRXY_H
  14.  
  15. #ifndef BASESHP_H
  16. #include "BaseShp.h"
  17. #endif
  18.  
  19. #ifndef BOUNDSHP_H
  20. #include "BoundShp.h"
  21. #endif
  22.  
  23. #ifndef LINESHP_H
  24. #include "LineShp.h"
  25. #endif
  26.  
  27. #ifndef OVALSHP_H
  28. #include "OvalShp.h"
  29. #endif
  30.  
  31. #ifndef RECTSHP_H
  32. #include "RectShp.h"
  33. #endif
  34.  
  35. #ifndef RRECTSHP_H
  36. #include "RRectShp.h"
  37. #endif
  38.  
  39. #ifndef TEXTSHP_H
  40. #include "TextShp.h"
  41. #endif
  42.  
  43. // ----- Part Layer -----
  44.  
  45. #ifndef FWFRMING_H
  46. #include "FWFrming.h"
  47. #endif
  48.  
  49. #ifndef FWPROXY_H
  50. #include "FWProxy.h"
  51. #endif
  52.  
  53. // ----- OpenDoc Includes -----
  54.  
  55. #ifndef SOM_ODShape_xh
  56. #include <Shape.xh>
  57. #endif
  58.  
  59. //========================================================================================
  60. // Forward Declaration
  61. //========================================================================================
  62.  
  63. class FW_CLASS_ATTR ODFrame;
  64. class FW_CLASS_ATTR ODTransform;
  65. class FW_CLASS_ATTR CDrawPart;
  66.  
  67. //========================================================================================
  68. //    class CProxyShape
  69. //========================================================================================
  70.  
  71. class FW_CLASS_ATTR CProxyShape : public CRectShape, public FW_MProxy
  72. {
  73.  public:
  74.     FW_DECLARE_CLASS
  75.     
  76. //----------------------------------------------------------------------------------------
  77. //    Initialization/Destruction
  78. //
  79. public:
  80.     CProxyShape(Environment* ev, const FW_CRect& rect, CDrawPart* drawPart);
  81.     CProxyShape(Environment* ev, CDrawPart* drawPart, FW_CReadableStream& archive);
  82.  
  83.     virtual ~CProxyShape();
  84.     
  85. //----------------------------------------------------------------------------------------
  86. //    Inherited API from FW_MProxy
  87. //
  88. public:
  89.     virtual void                 UsedShapeChanged(Environment* ev, 
  90.                                     FW_CEmbeddingFrame* embeddingFrame, 
  91.                                     ODFrame* odEmbeddedFrame);
  92.     
  93.     virtual ODShape*            FrameShapeRequested(Environment* ev, 
  94.                                         ODFrame* odEmbeddedFrame, 
  95.                                         ODShape* frameShape);
  96.                                             
  97. //----------------------------------------------------------------------------------------
  98. //    Inherited API from CRectShape
  99. //
  100. public:
  101.     virtual void         Removed(Environment* ev);
  102.     virtual void        Deleted(Environment* ev);
  103.     virtual void        RestoreShape(Environment *ev, CDrawPart* drawPart);                
  104.  
  105.     virtual void         RenderShape(Environment* ev, ODFacet* facet, FW_CGraphicContext& gc);
  106.  
  107.     virtual void        SubtractToWindowClip(Environment *ev, 
  108.                                             CDrawFacetClipper* facetClipper, 
  109.                                             ODFacet* containingFacet, 
  110.                                             ODShape* windowClip,
  111.                                             ODShape* tempShape);
  112.     
  113.     virtual void        OffsetShape(Environment *ev, FW_CFixed xDelta, FW_CFixed yDelta);
  114.     virtual void        MapShape(Environment *ev, CDrawPart* part, const FW_CRect& srcRect, const FW_CRect& dstRect);
  115.     virtual void        GetHandleCenter(short whichHandle, FW_CPoint& center) const;
  116.     
  117.     virtual void         SelectShape(Environment *ev, FW_Boolean state);
  118.  
  119.     virtual void        ChangeRenderVerb(Environment *ev, CDrawPart* part, unsigned short renderVerb);
  120.     
  121.     // ----- z-Order -----
  122.     virtual void         MovedAfter(Environment *ev, CBaseShape* shape);
  123.     virtual void         MovedBefore(Environment *ev, CBaseShape* shape);
  124.     virtual void         MovedFirst(Environment *ev);
  125.     virtual void         MovedLast(Environment *ev);
  126.     
  127.     // ----- Frozen -----
  128.     virtual FW_Boolean    SetFrozen(FW_Boolean state);
  129.     virtual FW_Boolean     IsFrozen() const;
  130.  
  131.     // ----- Archiving -----
  132.     virtual void        Flatten(FW_CWritableStream& archive);    
  133.     static void*         Read(FW_CReadableStream& archive);
  134.  
  135.     // ----- Linking -----
  136.     virtual void        SetSubscribeLink(Environment* ev, 
  137.                             CDrawSubscribeLink *subscribeLink);
  138.     virtual void        SetPublishLink(Environment* ev, 
  139.                             CDrawPublishLink *subscribeLink);
  140.  
  141. //-----------------------------------------------------------------------------------------
  142. //    New API
  143. //
  144. public:
  145.     void                 MoveBefore(Environment* ev, CProxyShape* before);
  146.     void                 MoveBehind(Environment* ev, CProxyShape* behind);
  147.     
  148.     void                ChangeLinkStatus(Environment* ev, ODLinkStatus linkStatus);
  149.  
  150.     FW_CRect            GetFrameRect(Environment* ev) const
  151.                                 {return fFrameRect;}
  152.     
  153. //----------------------------------------------------------------------------------------
  154. //    Data Member
  155. //
  156. public:
  157.     static unsigned long gProxyCount;
  158.  
  159. private:
  160.     CDrawPart            *fDrawPart;
  161.     FW_Boolean            fFrozen;
  162.     FW_CRect            fFrameRect;        // cached frame Rect
  163. };
  164.  
  165. #endif
  166.